package com.dong.common.mq;


import java.io.Serializable;

/**
 *
 * MQ配置参数
 *
 * @author zhaodongchao
 * @date 2020/11/19 14:05
 */
public class BaseConfig implements Serializable {
    private static final long serialVersionUID = 6025258186921650982L;
    /**
     * mq主题
     */
    private String topic;

    /**
     * 您在控制台创建的Group ID，用于对消费者或生产者实例进行分类
     */
    private String groupId;

    /**
     * 阿里云身份验证AccessKey ID，在阿里云用户信息管理控制台获取
     */
    private String accessKey;

    /**
     * 阿里云身份验证AccessKey Secret，在阿里云用户信息管理控制台获取
     */
    private String secretKey;

    /**
     * 设置TCP接入域名，进入控制台的实例详情页面的TCP协议客户端接入点区域查看
     */
    private String nameSrvAddr;

    /**
     * 用户渠道，默认值为：ALIYUN，聚石塔用户为：CLOUD。
     */
    private String onsChannel;

    /*--------------- 消息生产配置参数 ------------------------------*/
    /**
     * 设置消息发送的超时时间，默认值：3000；单位：毫秒。
     */

    private Long sendMsgTimeoutMillis;

    /*--------------- 消息订阅配置参数 ------------------------------*/
    /**
     * 设置Consumer实例的消费线程数，默认值：20。
     */
    private Integer consumeThreadNums;

    /**
     * 消息过滤表达式，例如“Tag A||Tag B”，说明消费者订阅了带有Tag A和Tag B两种Tag的消息
     */
    private String expression;

    /**
     * 设置Consumer实例的消费模式，取值说明如下：
     * 1 CLUSTERING（默认值）：表示集群消费。
     * 2 BROADCASTING：表示广播消费
     */
    private String messageModel ;
    /**
     * 设置消息消费失败的最大重试次数，默认值：16。
     */
    private Integer maxReconsumeTimes ;

    /**
     * 客户端本地的最大缓存消息数据，默认值：1000，单位：条
     */
    private Integer maxCachedMessageAmount;

    /**
     * 	客户端本地的最大缓存消息大小，取值范围：16 MB~2 GB，默认值：512 MB。
     */
    private Integer maxCachedMessageSizeInMiB;


    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getNameSrvAddr() {
        return nameSrvAddr;
    }

    public void setNameSrvAddr(String nameSrvAddr) {
        this.nameSrvAddr = nameSrvAddr;
    }

    public String getOnsChannel() {
        return onsChannel;
    }

    public void setOnsChannel(String onsChannel) {
        this.onsChannel = onsChannel;
    }

    public Long getSendMsgTimeoutMillis() {
        return sendMsgTimeoutMillis;
    }

    public void setSendMsgTimeoutMillis(Long sendMsgTimeoutMillis) {
        this.sendMsgTimeoutMillis = sendMsgTimeoutMillis;
    }

    public Integer getConsumeThreadNums() {
        return consumeThreadNums;
    }

    public void setConsumeThreadNums(Integer consumeThreadNums) {
        this.consumeThreadNums = consumeThreadNums;
    }

    public String getExpression() {
        return expression;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

    public String getMessageModel() {
        return messageModel;
    }

    public void setMessageModel(String messageModel) {
        this.messageModel = messageModel;
    }

    public Integer getMaxReconsumeTimes() {
        return maxReconsumeTimes;
    }

    public void setMaxReconsumeTimes(Integer maxReconsumeTimes) {
        this.maxReconsumeTimes = maxReconsumeTimes;
    }

    public Integer getMaxCachedMessageAmount() {
        return maxCachedMessageAmount;
    }

    public void setMaxCachedMessageAmount(Integer maxCachedMessageAmount) {
        this.maxCachedMessageAmount = maxCachedMessageAmount;
    }

    public Integer getMaxCachedMessageSizeInMiB() {
        return maxCachedMessageSizeInMiB;
    }

    public void setMaxCachedMessageSizeInMiB(Integer maxCachedMessageSizeInMiB) {
        this.maxCachedMessageSizeInMiB = maxCachedMessageSizeInMiB;
    }

    @Override
    public String toString() {
        return "BaseConfig{" +
                "topic='" + topic + '\'' +
                ", groupId='" + groupId + '\'' +
                ", accessKey='" + accessKey + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", nameSrvAddr='" + nameSrvAddr + '\'' +
                ", onsChannel='" + onsChannel + '\'' +
                ", sendMsgTimeoutMillis=" + sendMsgTimeoutMillis +
                ", consumeThreadNums='" + consumeThreadNums + '\'' +
                ", expression='" + expression + '\'' +
                ", messageModel='" + messageModel + '\'' +
                ", maxReconsumeTimes=" + maxReconsumeTimes +
                ", maxCachedMessageAmount=" + maxCachedMessageAmount +
                ", maxCachedMessageSizeInMiB=" + maxCachedMessageSizeInMiB +
                '}';
    }
}
